//获取读取文件的方法
const {readFile} = require('fs');
//获取转化 promise 风格的函数
const {promisify} = require('util'); //解构赋值   {promisify: function(){}}

//创建返回 promise 风格的函数
const mineReadFile = promisify(readFile);

//
async function main(){
    try{
        //读取第一个文件的内容
        let one = await mineReadFile('./resource/1.html');
        let two = await mineReadFile('./resource/2.html');
        let three = await mineReadFile('./resource/3.html');
        console.log(one.toString() + two.toString() + three.toString());
    }catch(e){
        console.log(e.errno);
    }
}

main();


